Skip to content

chore: tighten GitHub Actions permissions - #36330

Merged
naltatis merged 2 commits into
masterfrom
chore/actions-permissions
Nov 17, 2026
Merged

naltatis merged 2 commits into
masterfrom
chore/actions-permissions

Conversation

@naltatis

@naltatis naltatis commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Reduces the workflow token permissions to what each job uses and cleans up related findings of the OpenSSF Scorecard. The repository default for workflow tokens is now read-only.

  • top-level permissions: {} in all workflows that had none
  • drop unused actions: write from the build jobs and their nightly and release callers
  • backport command gets contents: read, it writes with the deploy token
  • checkouts for code review, PR labeling, CodeQL and OpenAPI validation no longer persist credentials
  • Docker Hub and Fly tokens are passed to the single step that needs them
  • pin the golang build image by digest
  • verify the Bun download by checksum, also when restored from cache
  • Dependabot also updates the local composite actions, 7 day cooldown for actions, docker and pip
  • remove the disabled language reminder workflow

TODO

  • first push to master: confirm cache saves work without actions: write
  • next /backport: confirm it works with the read-only token

🤖 Generated with Claude Code

@naltatis naltatis added the infrastructure Basic functionality label Nov 16, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/release.yml" line_range="96" />
<code_context>
     runs-on: depot-ubuntu-24.04-arm
     permissions:
-      contents: write
+      contents: read
       issues: write
       pull-requests: write
</code_context>
<issue_to_address>
**Release cleanup still gets write access**

When a release run reaches the cleanup job and has a release branch to delete, the `cleanup` job still grants `contents: write` and persists the default `GITHUB_TOKEN` in its checkout, then uses it to delete the release branch. That leaves a release job writing with the workflow token rather than the deploy token, contrary to the stated permission reduction.

Use `RELEASE_DEPLOY_TOKEN` for the cleanup checkout and branch deletion, and reduce that job’s `contents` permission to `read`.
</issue_to_address>

### Comment 2
<location path=".github/actions/setup-bun/action.yml" line_range="11-13" />
<code_context>
   version:
     description: Bun version, keep in sync with the pinned claude-code-action
     default: 1.4.4
+  sha256:
+    description: Checksum of bun-linux-x64.zip for that version, from the release's SHASUMS256.txt
+    default: bf8ccbfb2b0b80159e0f9a6d15c55317add8077534dbc6130a3edb52fccb395c

 outputs:
</code_context>
<issue_to_address>
**Bun setup fails for version overrides**

When a caller overrides `version` but leaves `sha256` at its default, `sha256sum -c` compares the downloaded archive for the selected version against the default 1.4.4 digest and exits nonzero, so setup fails before Bun is installed.

Make the checksum match the selected version or require callers to provide a matching checksum when overriding `version`.

Also at `.github/actions/setup-bun/action.yml:45`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .github/workflows/release.yml Resolved
Comment thread .github/actions/setup-bun/action.yml Resolved
@andig

andig commented Nov 16, 2026

Copy link
Copy Markdown
Member

Dunno…

@naltatis

Copy link
Copy Markdown
Member Author

Ok, merge and see/fix if something breaks.

@naltatis
naltatis merged commit 10ec285 into master Nov 17, 2026
15 checks passed
@naltatis
naltatis deleted the chore/actions-permissions branch November 17, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Basic functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants